package com.issac.controller;


import com.issac.repository.StudentRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/index")
public class IndexHandler {
    @Autowired
    private StudentRepository studentRepository;
    @GetMapping("index")
    public String index(Model model){
        model.addAttribute("list",studentRepository.findAll());
        return "index";
    }
}
